UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A7VXa5/eA9jB2pvPD4TRfEUUkQghQfz2v3zA39Re7ZI='
WHERE
key_id = '6406b90b11f39d3977b42980e9822e370e759ad7cd97b74d5ba4a65d975594c4'
AND (
token = 'A7VXa5/eA9jB2pvPD4TRfEUUkQghQfz2v3zA39Re7ZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)