UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'enhjbUoYvwKSW3+3hKgdQm/fHM6TCywyTunrYDjwXNk='
WHERE
key_id = '74994d893295322fd2030154a09535d3a65c287952c14a0e7262ae0d51b536f9'
AND (
token = 'enhjbUoYvwKSW3+3hKgdQm/fHM6TCywyTunrYDjwXNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)