UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2agTjXNCJOWPbDEdUWu9WOkI1LN5O+9dSsLsHtYxcpY=' 
WHERE 
  key_id = '2cd41f4c89b7606fea692426a1c91ab89d9736363711cff55d71f8168d3c58fd' 
  AND (
    token = '2agTjXNCJOWPbDEdUWu9WOkI1LN5O+9dSsLsHtYxcpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033