UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bqG+s7aKo/79371XSPqeQ6/+fWYLIHSNve+145yCmSg='
WHERE
key_id = 'fb6da32289b92425369166cd193be2e58d9cc50a787b1a415caf70f91891f295'
AND (
token = 'bqG+s7aKo/79371XSPqeQ6/+fWYLIHSNve+145yCmSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)