UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4v/f4JEfI0ZO5vdUh17Qvx4ZLWm8FDCxgb9+e1crrvU='
WHERE
key_id = '6fa9c3d56201004be819ddecebd0b5232fe976d9c4f7229289fa76ef92e5b32c'
AND (
token = '4v/f4JEfI0ZO5vdUh17Qvx4ZLWm8FDCxgb9+e1crrvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)