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