UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R1UI0istfv2lOFsTpOhdW0Hy178euGUIUo1idh18Gr4='
WHERE
key_id = '182770a1f4c0d610b8ba34d0fbfc502c68d73df6ab9e92d9c68519bd1cb3be2c'
AND (
token = 'R1UI0istfv2lOFsTpOhdW0Hy178euGUIUo1idh18Gr4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)