UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dXlNk/BzaF/cIlh9N6SINe29g//xc9nqH19u+Wfzz2k='
WHERE
key_id = '1cd636cff37f23c386480bafcf5b88aec10dea350b71a595964a6b30289bbdfc'
AND (
token = 'dXlNk/BzaF/cIlh9N6SINe29g//xc9nqH19u+Wfzz2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)