UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2lBmvvBhssvrnCLAVD+5jZX+Ck2bW8lwhIrrsAgpaOs='
WHERE
key_id = '217dbe59001d9a17955c6aca995610751ed6eb641abfb1e97dfde3125a358285'
AND (
token = '2lBmvvBhssvrnCLAVD+5jZX+Ck2bW8lwhIrrsAgpaOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)