UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+OB1HfhZbRI/mdLyUq3DbNEDguc6qa+RFI0VQxj7YAo='
WHERE
key_id = 'a79f52bd57dc270554f3601f5e5d3bdcbd7046a0c3e6a010487c3a22feb265c4'
AND (
token = '+OB1HfhZbRI/mdLyUq3DbNEDguc6qa+RFI0VQxj7YAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)