UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dqY3rZOYqfkyxB+Rppl1LKTYjb2F1KM19Qr+bxYJ8F8=' 
WHERE 
  key_id = '14099774217f32b72d91cfffd8e128397303900fa9bf43f8cd36ef4691371cc7' 
  AND (
    token = 'dqY3rZOYqfkyxB+Rppl1LKTYjb2F1KM19Qr+bxYJ8F8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027