UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IgxiauzWMqlOUWbnhL1jdB6xCSBRb98Vh6YdqC9H9eY='
WHERE
key_id = 'cd8baa2d98a637acc081f27ac15401f38188dceb16eb1f78d560c8974ac88cc9'
AND (
token = 'IgxiauzWMqlOUWbnhL1jdB6xCSBRb98Vh6YdqC9H9eY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)