UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DsMFKtLSq9DpjC5OFufIHPHFCcB2JoFrtzEE5/48boc='
WHERE
key_id = '8797875803da74097af765a74cc42feca7f82b446e31477ec8192fc2000abf47'
AND (
token = 'DsMFKtLSq9DpjC5OFufIHPHFCcB2JoFrtzEE5/48boc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)