UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5g2BsRYBGJ6/GV9/ncf9pCe3QQORuChIggEkSKU9JeQ=' 
WHERE 
  key_id = '16467897491c2278a07fee30486f7efa7d04079af637fd3411df156d6ab407e6' 
  AND (
    token = '5g2BsRYBGJ6/GV9/ncf9pCe3QQORuChIggEkSKU9JeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044