UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pz06SQNQZMnYDp6ER8QlRZ/NyvxN5avAJlxHxWaXX8k='
WHERE
key_id = '27f19455a61e1221a0bfdea4ac50d67cc7a5c0f39a59ec9dbe81d4ae19cb2364'
AND (
token = 'pz06SQNQZMnYDp6ER8QlRZ/NyvxN5avAJlxHxWaXX8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)