UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'adkeNo+l4/tAdW/4P5KhQ724bOQ5B54jJEjVhU6qw6g='
WHERE
key_id = '598d7d8ab70087b1b6b479e04ae445432c73a8a7b32e792361659d2912c5c69a'
AND (
token = 'adkeNo+l4/tAdW/4P5KhQ724bOQ5B54jJEjVhU6qw6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)