UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'haAyxWZFG9bLuYreGsCU8P3hOGeHf+AZ7sTLcjwynPo=' 
WHERE 
  key_id = '19801e1c7cfe0a1a04440d39aaf103d097fc5e69748a9ad097eea72b287c384a' 
  AND (
    token = 'haAyxWZFG9bLuYreGsCU8P3hOGeHf+AZ7sTLcjwynPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059