UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n2QaMQgRm/UD1tooOlRxvAU3bacFKNRjxY4XSQ91kew='
WHERE
key_id = '043ed11799fc6e956d837149756ca044c7c43d9259ccccd12bb88e643fdcb47a'
AND (
token = 'n2QaMQgRm/UD1tooOlRxvAU3bacFKNRjxY4XSQ91kew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)