UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mAPAE7b6lP/pKijUuU1cYKOLJg0OnfBPf+rGMMC9LxE=' 
WHERE 
  key_id = '5f84d2496f4d1f01efb79d2faff7824f19a2b8bd36f85aae1aa559fa4d8d7f5f' 
  AND (
    token = 'mAPAE7b6lP/pKijUuU1cYKOLJg0OnfBPf+rGMMC9LxE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027