UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uqICzlweRXI2pkZPZAHRpzjBmzMkhtnJgXe6Q6lQn7U=' 
WHERE 
  key_id = '21371b8baf47a3ea1f5f8e1de4957cb3867f94738c9fef6dbcab69b8ca8909fa' 
  AND (
    token = 'uqICzlweRXI2pkZPZAHRpzjBmzMkhtnJgXe6Q6lQn7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033