UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+H7cRG3pSpSNFYw6iEg5opwNsjAp3t9i1xsIuhDjCwc='
WHERE
key_id = 'cd70fc2fafc74de71b2007f53c61634da027141e789dc928ba8fd00f42cc06ad'
AND (
token = '+H7cRG3pSpSNFYw6iEg5opwNsjAp3t9i1xsIuhDjCwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)