UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gKHzrWMpmNZ5QKt0rPrYCxud0w3+q/r0dX7W9A/M6Ig='
WHERE
key_id = 'a0ff4e1fb0a2ec2cbe6f2d16c005daedadba011f8f949fbf6a596c77e76b04b2'
AND (
token = 'gKHzrWMpmNZ5QKt0rPrYCxud0w3+q/r0dX7W9A/M6Ig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)