UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hzXblDtiptTAeEp/QLktKQPmSFSvn7St8gGZGhEplI='
WHERE
key_id = '4c9b6927fdab174edd49705551bb21d3e30770696f967d3e65661ed14a062748'
AND (
token = '3hzXblDtiptTAeEp/QLktKQPmSFSvn7St8gGZGhEplI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)