UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AMTwZSAVbyBaY69f5yJIkUo+0McJlZYeIrRon2/1ZYE='
WHERE
key_id = 'e53ce05cdae3edb5c0f13c85dd3c99b76cce22bbad51462347460c7a19e93a8f'
AND (
token = 'AMTwZSAVbyBaY69f5yJIkUo+0McJlZYeIrRon2/1ZYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)