UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NaqNbc2ZIbiSEwSIcTOS/EFnBolqscXHxfZozo6sgB0='
WHERE
key_id = 'acb3e1a6b8a6c1f5c18a317b66d3884644ffec7dd479928ec80b98c81c49e369'
AND (
token = 'NaqNbc2ZIbiSEwSIcTOS/EFnBolqscXHxfZozo6sgB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)