UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nWKvw04KdVGgJTyhlqVZfpmOxLNxl7LW53+hTEXPJHw=' 
WHERE 
  key_id = '0d1a4d2c0aabfd41cd7277d146f2ef31626509988e9c4d8e5b7b4bcc14c6c840' 
  AND (
    token = 'nWKvw04KdVGgJTyhlqVZfpmOxLNxl7LW53+hTEXPJHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051