UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5mWqcu+/xqFYNXi1Y+a5HJ2xZO0v4OyrQMQXlpm6fk8='
WHERE
key_id = 'ff80adec7e761c2a9da2e521788a481951e4f1f55bbe782ca6951b2ba6271652'
AND (
token = '5mWqcu+/xqFYNXi1Y+a5HJ2xZO0v4OyrQMQXlpm6fk8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)