UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/6hRGPH6GFPobE/ECFgNcjIECFVmPX4cXW1t6e7st4='
WHERE
key_id = '528963e72a3c81a17b5863c2fcf3bc9b50a24b85096488db470a4963b8df96dc'
AND (
token = 'V/6hRGPH6GFPobE/ECFgNcjIECFVmPX4cXW1t6e7st4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)