UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'flS+inH6MK/TlNrBeNcHs9ovxx69hqLaIGvBtFy0OhU='
WHERE
key_id = '18a5414f548ed945bfd7de699b553d8faff2cf23b8f3481dcb5c7c1e941a8529'
AND (
token = 'flS+inH6MK/TlNrBeNcHs9ovxx69hqLaIGvBtFy0OhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)