UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bj3UoVlcdNbf+CsnSkZFSdxh5xrbn17vCUIO++57Usw='
WHERE
key_id = '393701923c830374d576e990653929671ca6ab05815bdb84493cc2a3eb220cc3'
AND (
token = 'Bj3UoVlcdNbf+CsnSkZFSdxh5xrbn17vCUIO++57Usw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)