UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o143r5SeOBbxZmnzGCPtgpauuGIl2um0Ethx1JyYtBI=' 
WHERE 
  key_id = '2d735feb16e03ba81fbd8310f67fa6d559df82db9593cab9df192e1f8dc8c46d' 
  AND (
    token = 'o143r5SeOBbxZmnzGCPtgpauuGIl2um0Ethx1JyYtBI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029