UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k98PH2dgkRg/yZADsvxZwS/Vvd9uj1yBeVwaLFiFNz4='
WHERE
key_id = 'cf9630c22951bd13ea4140b2dcc937b8370723b5162cdbe037fa6ca21210c8af'
AND (
token = 'k98PH2dgkRg/yZADsvxZwS/Vvd9uj1yBeVwaLFiFNz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)