UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0E/loBsLI0lnJ3ll9UuSYSd4+YryBkmfxWviVLdWFsE='
WHERE
key_id = 'c541e482da5cc5b9504c57c24f0bd3e3ff381a5717c05c92a8b5628a4534f515'
AND (
token = '0E/loBsLI0lnJ3ll9UuSYSd4+YryBkmfxWviVLdWFsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)