UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'epoGRZ5UTTQ6JV5Sc9A+rr7/6yflYDxiT8QiEK1HsrI=' 
WHERE 
  key_id = 'ab3f11d38ec5dbeb0e2dbecc90ab54eae4ea8aa95726d1396ccb0c2814a312ba' 
  AND (
    token = 'epoGRZ5UTTQ6JV5Sc9A+rr7/6yflYDxiT8QiEK1HsrI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018