UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M8Mp9tRgGQbemJARQk+4AyMopnsE3Ii0o96JZXZzkLA=' 
WHERE 
  key_id = '1bcefba18e75f7e95ed5cfa3ff9c169eb92297f6da1ae4eae04eb4cfc3998052' 
  AND (
    token = 'M8Mp9tRgGQbemJARQk+4AyMopnsE3Ii0o96JZXZzkLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028