UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQ+/kvbm3oP2HETIfciggqZ3kX5qTP/ahOyO+YUdwnk='
WHERE
key_id = 'e80645ea53b4867fe0d2a0f34de1b32dc3d49b39da1c20434b50705c0c641f6d'
AND (
token = 'SQ+/kvbm3oP2HETIfciggqZ3kX5qTP/ahOyO+YUdwnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)